home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 999 < prev   
Encoding:
Internet Message Format  |  1996-08-06  |  2.3 KB

  1. From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
  2. Message-ID: <4k8g95$jcq@mulga.cs.mu.OZ.AU>
  3. X-Original-Date: 7 Apr 1996 13:34:29 GMT
  4. Path: in1.uu.net!bounce-back
  5. Date: 08 Apr 96 09:03:00 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: dynamic_cast<void*>
  9. Organization: Comp Sci, University of Melbourne
  10. References: <4k1a4r$dim@rznews.rrze.uni-erlangen.de>
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBFAgUBMWjWS+EDnX0m9pzZAQFd/gF+K/Z7I2g+Z56Ea6w1+AnCKVp1vPtwy1Rw
  13.     /EmbWLKtycINQKPcWubkimtWpFY4/lGQ
  14.     =cNU/
  15.  
  16. anhaeupl@late.e-technik.uni-erlangen.de (Bernd Anhaeupl) writes:
  17.  
  18. >Section 5.2.6 paragraph 7 of the April 95 WP states, that for
  19. >polymorphic types, the result of a dynamic_cast<void*>(v) "is a
  20. >pointer to the complete object (12.6.2) pointed to by v". Now 
  21. >section 12.6.2 does not define the term "complete object", which
  22. >actually happens in section 1.4 paragraph 2, but the term 
  23. >"most derived class". This makes a differnce, if we pass a pointer
  24. >to a data member subobject (and not a base class subobject) to
  25. >dynamic_cast. According to 12.6.2, we would get the address of that
  26. >data member, according to 1.4, the address of the containing 
  27. >object of that data member.
  28. >
  29. >Please note, that the term "complete object (12.6.2)" is also used 
  30. >in section 5.2.7, where the typeid expression is defined. Therefore 
  31. >I suppose, that in 5.2.6 and 5.2.7 "most derived object" is meant 
  32. >instead of "complete object" in both sections. Is this correct?
  33.  
  34. Yes.  
  35.  
  36. The term "complete object" was used to mean two different things
  37. by different members of the C++ committee; one of those meanings
  38. is what is now called "most derived object".
  39.  
  40. This error has been corrected in the Jan 96 draft, both in 5.2.6
  41. and in 5.2.7.
  42.  
  43. --
  44. Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
  45. WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
  46. PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
  47. ---
  48. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  49. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  50. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  51. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  52. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  53.